package cn.edu.scau.cmi.chenjia.singleton;

import java.util.HashSet;
import java.util.Set;

public class Marshal {
	private String name;
	private static Set<Marshal> marshalSet=new HashSet<Marshal>();
	
	private Marshal(String name) {
		this.name=name;
	}
	public static Set<Marshal> addInstance(String name) {
		if(marshalSet.size()<=10) {
			Marshal marshal=new Marshal(name);
			marshalSet.add(marshal);
			
		}
		return marshalSet;
		
	}
	public static boolean complete() {
		if(marshalSet.size()>10) {
			return true;
		}
		else {
			return false;
		}
	}
}
